#ifndef MONITORTHREAD_H
#define MONITORTHREAD_H

#include <QThread>
#include <QDebug>
#include <QProgressDialog>
#include <QProgressBar>
#include <QVBoxLayout>
extern int num;
extern long long written;

class MonitorThread : public QThread {
    Q_OBJECT

public:
    explicit MonitorThread(QObject* parent = nullptr);

    void setFraction(int denominator, QProgressBar* progressBar);

protected:
    void run() override;

signals:
    void progressUpdated(int value);

private:
    int denominator_;
    QProgressBar* progressBar_;
    QProgressDialog* progressDialog_;

    int getGlobal() {
        extern int num;
        return num;
    }
};

#endif // MONITORTHREAD_H
